package com.empire.module.member.dal.mysql.superrelationnode;

import java.util.*;

import com.empire.framework.common.pojo.PageResult;
import com.empire.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.empire.framework.mybatis.core.mapper.BaseMapperX;
import com.empire.module.member.dal.dataobject.superrelationnode.SuperRelationNodeDO;
import org.apache.ibatis.annotations.Mapper;
import com.empire.module.member.controller.admin.superrelationnode.vo.*;

/**
 * 超级关系--节点信息 Mapper
 *
 * @author 主席大人
 */
@Mapper
public interface SuperRelationNodeMapper extends BaseMapperX<SuperRelationNodeDO> {

    default PageResult<SuperRelationNodeDO> selectPage(SuperRelationNodePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SuperRelationNodeDO>()
                .betweenIfPresent(SuperRelationNodeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(SuperRelationNodeDO::getNodeId, reqVO.getNodeId())
                .eqIfPresent(SuperRelationNodeDO::getPersonId, reqVO.getPersonId())
                .likeIfPresent(SuperRelationNodeDO::getNodeName, reqVO.getNodeName())
                .eqIfPresent(SuperRelationNodeDO::getNodeType, reqVO.getNodeType())
                .eqIfPresent(SuperRelationNodeDO::getAvatar, reqVO.getAvatar())
                .eqIfPresent(SuperRelationNodeDO::getOtherInformation, reqVO.getOtherInformation())
                .eqIfPresent(SuperRelationNodeDO::getNodeDirection, reqVO.getNodeDirection())
                .orderByDesc(SuperRelationNodeDO::getId));
    }

}